<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //重复生成
        // console.log('*'.repeat(3));
        function phone(mobile, len = 3) {
            return String(mobile).slice(0, len * -1) + "*".repeat(len);
        }
        console.log(phone(173279173, 6));
    </script>
</body>

</html>